export const STRING_TYPE = 'String';
export const ARRAY_TYPE = 'Array';
export const OBJECT_TYPE = 'Object';
export const BOOLEAN_TYPE = 'Boolean';
export const INTEGER_TYPE = 'Integer';
export const DOUBLE_TYPE = 'Double';
export const LONG_TYPE = 'Long';
export const ANY_TYPE = 'Any';

export const SCHEMA_TYPE = [
  STRING_TYPE,
  INTEGER_TYPE,
  DOUBLE_TYPE,
  ARRAY_TYPE,
  OBJECT_TYPE,
  BOOLEAN_TYPE,
  LONG_TYPE,
  ANY_TYPE,
];

export const RULES = {
  required: {
    type: 'required',
    message: '不能为空',
  },
  length: {
    type: 'length',
  },
  regex: {
    type: 'regex',
  },
  enums: {
    type: 'enums',
  },
  formatter: {
    type: 'formatter',
  },
};
